/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/5/7 9:39
 * @Copyright 博为峰
 */
public class ArrayDemo02 {
    public static void main(String[] args) {
        /*
           1.存
           2.取
         */
        int[] arr = new int[5];
        arr[0] = 6;
        arr[1] = 9;

//        System.out.println(arr[1]);
//        System.out.println(arr[5]);//ArrayIndexOutOfBoundsException 下标越界异常

//        arr = null; // ""
//        System.out.println(arr[1]);//NullPointerException 空指针异常

//        System.out.println(arr.length);//数组长度

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
